<html>
	<head>
		<meta name="layout" content="main"/>
		<link rel="stylesheet" href="${resource(dir: 'css', file: 'gallery.css')}" type="text/css">
	</head>
	<body>
		<g:if test="${editMode == 'true'}">
			<div class="page-info">
				Select the project you wish to edit
			</div>
		</g:if>
		<g:each in="${ galleryProjectGroups }" var="galleryProjectGroup">
			<div class="page-content">
				<div class="thumbnail-image-group">
					<div class="header-image-group">${galleryProjectGroup.projectGroup.name}</div>
					<hr/>
					<table>
						<g:each in="${ galleryProjectGroup.projectRows }" var="row">
							<tr>
								<g:each in="${ row }" var="project">
									<td>
										<g:if test="${editMode == 'true'}">
											<g:link controller="admin" action="projectEditor" params="[projectId: project.id]">
												<div class="gallery-project-name">${ project.name }</div>
												<div class="thumbnail-image">
													<img src="<g:createLink controller="gallery" action="getImageByPath" params="[imagePath: project.thumbnailPath]"/>" />
												</div>
											</g:link>
										</g:if>
										<g:else>
											<g:link controller="gallery" action="project" params="[projectId: project.id]">
												<div class="gallery-project-name">${ project.name }</div>
												<div class="thumbnail-image">
													<img src="<g:createLink controller="gallery" action="getImageByPath" params="[imagePath: project.thumbnailPath]"/>" />
												</div>
											</g:link>
										</g:else>
									</td>
								</g:each>
							</tr>
						</g:each>
					</table>
				</div>
			</div>
		</g:each>
	</body>
</html>